<?php
if(!defined('IN_PHPSCUP'))exit('hacking'); 
class UpfileModel extends BaseModel
{

    var $table  = 'up_files';	

    var $_page_rows = 20;	
	
    /* 插入数据 */
    function post($data)
    {    
	
		$time = time();     
    
		return $this->IU_Sql_Exe(array ('data' => array('uid'=>"$data[uid]",'con_id'=>"$data[con_id]",'file_url'=>"$data[file_url]",'file_size'=>"$data[size]",'file_type'=>"$data[type]",'appname'=>"$data[appname]",'upl_time'=>"$time",'is_temp'=>"0"), 'mode' => 'INSERT'));

        
    }

    function show()
    {   
	
		 $info = $this->S_Sql_Exe(array('fields' =>'*'));
    
		 return $info;
        
    }


    function selct($cid,$appname='')
    {   
	
		 $info = $this->S_Sql_Exe(array('fields' =>'*','conditions' =>"con_id = '{$cid}' and appname = '{$appname}' "));
    
		 return $info;
        
    }


    /* 删除数据 */
    function del($id ='')
    {      
		return $this->D_Sql_Exe(array ('conditions' =>"id = '{$id}' "));
        
    }


    /* 通过id取出一条数据 */
    function oneshow($id ='')
    {    
	      
		 $info = $this->S_Sql_Exe(array('fields' =>'*','conditions' =>"id='{$id}'",'return' =>'one'));
    
		 return $info;
        
    }


}






?>